<?php

function wkname()
{
	$data = array(
	    "29" => "秒课模板",
		"tuboshu" => "土拨鼠论文",
        "mixuegk" => "蜜雪国开"

	    );
	return $data;
}

function addWk($oid){
	global $DB;
	global $wk;
	$d = $DB->get_row("select * from qingka_wangke_order where oid='{$oid}' ");
	$cid = $d["cid"];
	$school = $d["school"];
	$user = $d["user"];
	$pass = $d["pass"];
	$kcid = $d["kcid"];
	$kcname = $d["kcname"];
	$noun = $d["noun"];
	$miaoshua = $d["miaoshua"];
	$b = $DB->get_row("select * from qingka_wangke_class where cid='{$cid}' ");
	$hid = $b["docking"];
	$a = $DB->get_row("select * from qingka_wangke_huoyuan where hid='{$hid}' ");
	$type = $a["pt"];
	$cookie = $a["cookie"];
	$token = $a["token"];
	$ip = $a["ip"];

    //国开单页 start
    $submitPeriod = (int)$d["submitPeriod"];
    $learnTimes = (int)$d["learnTimes"];
    $learnDays = (int)$d["learnDays"];
    $finishLives = (int)$d["finishLives"];
    $doForum = (int)$d["doForum"];
    $doExam = (int)$d["doExam"];
    $doHomework = (int)$d["doHomework"];
    $doActivities = (int)$d["doActivities"];
    $doHomeworkMode = (int)$d["doHomeworkMode"];
    $doNightLearn = (int)$d["doNightLearn"];
    //国开单页 end


    if ($type == "29") {
        $data = array("uid" => $a["user"], "key" => $a["pass"], "platform" => $noun, "school" => $school, "user" => $user, "pass" => $pass, "kcname" => $kcname, "kcid" => $kcid);

        $ace_rl = $a["url"];
        $ace_url = "$ace_rl/api.php?act=add";
        $result = get_url($ace_url, $data);
        $result = json_decode($result, true);
        if ($result["code"] == "0") {
        $b = array("code" => 1, "msg" => "下单成功");
        } else {
        $b = array("code" => -1, "msg" => $result["msg"]);
        }
    return $b;
    } else if ($type == "mixuegk") {
        $data = array("uid" => $a["user"], "key" => $a["pass"], "platform" => $noun, "school" => $school, "user" => $user, "pass" => $pass, "kcname" => $kcname, "kcid" => $kcid, "tag" => 1, "submitPeriod" => $submitPeriod, "learnTimes" => $learnTimes, "learnDays" => $learnDays, "finishLives" => $finishLives, "doForum" => $doForum, "doExam" => $doExam, "doHomework" => $doHomework, "doActivities" => $doActivities, "doHomeworkMode" => $doHomeworkMode, "doNightLearn" => $doNightLearn);
//        print_r($data);
        $DB->query("INSERT INTO test_log (log
                ) VALUES ('{$data}'
                )");
        $ace_rl = $a["url"];
        $ace_url = "$ace_rl/api.php?act=add-gk";
        $result = get_url($ace_url, $data);
        $result = json_decode($result, true);
        if ($result["code"] == "0") {
            $b = array("code" => 1, "msg" => "下单成功");
        } else {
            $b = array("code" => -1, "msg" => $result["msg"]);
        }
        return $b;
    }

	else{
	    print_r("没有了,文件xdjk.php,可能故障：参数缺少，比如平台名错误！！！");die;
	}

}


?>
